/**
 * 支持安装svg组件
 * @Author bianpengfei
 * @create 2020/10/22 11:07
 */

// types
import type { App } from 'vue'

export default {
  install(app: App) {
    // requires and returns all modules that match
    const requireAll = (requireContext) => requireContext.keys().map(requireContext)
    //
    // // import all svg
    // @ts-expect-error
    const req = require.context('@/assets/svg', true, /\.svg$/)
    requireAll(req)
    return app
  }
}
